# import json
import random

# self_id_list, match_id_list = [], []
# with open('../JsonData/is_match_user.json', 'r', encoding='utf-8') as file:
#     data = json.load(file)
#     # print(data)
#     self_list = [item.get('self_data').get('id') for item in data.get('data')]
#     match_list = [item.get('match_data').get('id') for item in data.get('data')]
#     print(self_list, match_list)
#
#     # for item in data.get('data'):
#     #     self_id, match_id = item.get('self_data').get('id'), item.get('match_data').get('id')
#     #     self_id_list.append(self_id), match_id_list.append(match_id)
#     # print(self_id_list, match_id_list)
#
# mood = {'1': '心动', '2': '开心', '3': '伤心', '4': '平静', '5': '烦躁', '6': '心累', '7': '生气', '8': '兴奋'}
#
# random_key = random.choice(list(mood))
# random_value = mood[random_key]
# print(random_value)


data = {'code': 200, 'data': [{'Question': '第一次约会是在校内还是校外？', 'Options': '校内||校外'},
                              {'Question': '我会为了送人礼物纠结很久吗？', 'Options': '超级纠结||偶尔纠结||不太纠结'},
                              {'Question': '我有以下哪个毛病？', 'Options': '强迫症||拖延症||选择困难症||以上都不是'},
                              {'Question': '我能接受对象抽烟吗？', 'Options': '能||不能'},
                              {'Question': '对我来说，最重要的电器是？', 'Options': '电视||电脑||冰箱||洗衣机'},
                              {'Question': '假如中了1000万，我会用来做什么？', 'Options': '买车买房||环游世界||投资理财'},
                              {'Question': '洗手间我更希望是？', 'Options': '坐便器||蹲便器'},
                              {'Question': '觉得中餐当中是四川吃的辣还是湖南吃的辣？', 'Options': '四川||湖南'},
                              {'Question': '我喜欢吃清淡还是喜欢吃重口味的食物？', 'Options': '清淡||麻辣'},
                              {'Question': '我说了谎会有什么反应',
                               'Options': '面红耳赤||面不改色||紧张结巴||说谎是个什么东西'}]}

question_list = [item.get('Question') for item in data.get('data')]
print(question_list)

# Options_list = [item.get('Options') for item in data.get('data')]
#
# answer_choice_list = [item.split('||') for item in Options_list]
#
# answer_list = [random.choice(answer_list) for answer_list in answer_choice_list]
# print(answer_list)
#
# tacit_dict = dict(zip(question_list, Options_list))
#
# print(tacit_dict)
#
# data2 = [
#     {
#         "Question": "我是很喜欢养宠物的人吗？",
#         "Options": "是的，养过宠物||喜欢但没养过||完全不喜欢"
#     },
#     {
#         "Question": "高中时的同桌我还在联系吗？",
#         "Options": "不联系||联系"
#     },
#     {
#         "Question": "在看电影时，我会选择哪种零食？",
#         "Options": "爆米花||瓜子||薯片||其他"
#     },
#     {
#         "Question": "如果可能,两人最想一起去哪里旅游?",
#         "Options": "亚洲||美洲||欧洲"
#     },
#     {
#         "Question": "我晚上睡觉会磨牙吗？",
#         "Options": "会||不会"
#     },
#     {
#         "Question": "希望有钱还是变聪明？",
#         "Options": "有钱||变聪明"
#     },
#     {
#         "Question": "我喜欢向日葵还是玫瑰？",
#         "Options": "向日葵||玫瑰"
#     },
#     {
#         "Question": "卫衣毛衣衬衣喜欢？",
#         "Options": "卫衣||毛衣||衬衣"
#     },
#     {
#         "Question": "我是更怕冷还是更怕热？",
#         "Options": "怕冷||怕热"
#     },
#     {
#         "Question": "我平时用洗面奶洗脸吗",
#         "Options": "用||不用||从不洗脸"
#     }
# ]
# Questions = list()
#
# for item in data2:
#     item['answer'] = answer_list[data2.index(item)]
#     Questions.append(item)
# print(Questions)
